//2009/08/01 17:49:23
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

class DiskSpace
{
public:
	int minDrives(vector <int> used, vector <int> total)
	{
		int use = 0;
		for(int i=0; i<used.size(); i++)
		{
			use += used[i];
		}
		sort(total.begin(), total.end());		//For Greedy, don't forget sort first.
		for(int i=total.size()-1; i>=0; i--)
		{
			if(total[i] - use >= 0)
				return (total.size() - i);
			use -= total[i];
		}
		return total.size();
	}
};
